| Visual Basic (Declaration) | |
|---|---|
Public Overloads Sub RegisterCallback( _ ByVal serviceTypeName As String, _ ByVal serviceMethodName As String, _ ByVal callback As Action(Of SubscriptionOperation), _ ByVal userToken As Object, _ ByVal ParamArray clientArgs() As Object _ ) | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As EntityManager Dim serviceTypeName As String Dim serviceMethodName As String Dim callback As Action(Of SubscriptionOperation) Dim userToken As Object Dim clientArgs() As Object instance.RegisterCallback(serviceTypeName, serviceMethodName, callback, userToken, clientArgs) | |
| C# | |
|---|---|
public void RegisterCallback( string serviceTypeName, string serviceMethodName, Action<SubscriptionOperation> callback, object userToken, params object[] clientArgs ) | |
| C++/CLI | |
|---|---|
public: void RegisterCallback( String^ serviceTypeName, String^ serviceMethodName, Action<SubscriptionOperation^>^ callback, Object^ userToken, ... array<Object^>^ clientArgs ) | |
Parameters
- serviceTypeName
- Name of type containing the service method
- serviceMethodName
- Name of service method
- callback
- Client method handling the pushed data
- userToken
- Token identifying the request
- clientArgs
- Optional arguments which can be passed to server code
| Exception | Description |
|---|---|
| System.ArgumentNullException | Thrown if the callback action is not provided |
| System.ArgumentException | Thrown if the serviceTypeName is not fully qualified |
| System.NotSupportedException | Thrown if called from server code |
Use RegisterCallback to register a client for messages or data "pushed" from the server. The serviceTypeName and serviceMethodName parameters indicate the method on the server which performs processing which the client wants to "subscribe" to. The callback indicates the client-side method which will be called whenever the server method pushes data. The userToken should be used to identify the client request. It does not have to be unique acrosss all clients, but it must be unique for all requests from a single client. The clientArgs can be used to pass argument data from the client through to the server. The server code can query for these arguments using the INotificationManager.GetSubscribers method.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family